Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Components: move displayName assignment to top-level files #64793

Merged
merged 3 commits into from
Aug 26, 2024

Conversation

ciampo
Copy link
Contributor

@ciampo ciampo commented Aug 26, 2024

What?

As discussed in #64613 (comment), this PR tweaks how the displayName is assigned to each sub-component.

Previously, each displayName assignment was performed in the sub-component files — this PR moves the assignments to the top-level file.

Why?

Since assigning a displayName to sub-components is a consequence of how we're building and exporting our composite components, moving the assignment closer to where the exported object is built just makes sense.

How?

Moved the assignments across files, updated the CONTRIBUTING guidelines accordingly.

Testing Instructions

This PR has no runtime changes

  • make sure the project builds
  • load storybook / the editor, make sure that Composite and DropdownMenuV2 subcomponents are named as expected in React Dev Tools and Storybook code snippets

@ciampo ciampo requested a review from ajitbohra as a code owner August 26, 2024 09:37
@ciampo ciampo self-assigned this Aug 26, 2024
Copy link

github-actions bot commented Aug 26, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ciampo <[email protected]>
Co-authored-by: mirka <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@ciampo ciampo requested review from mirka and tyxla August 26, 2024 09:37
@ciampo ciampo added [Type] Developer Documentation Documentation for developers [Package] Components /packages/components labels Aug 26, 2024
Copy link
Member

@mirka mirka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the consistency cleanup!

@ciampo ciampo merged commit 8a24345 into trunk Aug 26, 2024
67 of 71 checks passed
@ciampo ciampo deleted the docs/components-composite-display-name branch August 26, 2024 17:04
@github-actions github-actions bot added this to the Gutenberg 19.2 milestone Aug 26, 2024
bph pushed a commit to bph/gutenberg that referenced this pull request Aug 31, 2024
…#64793)

* Update CONTRIBUTING guidelines

* Update Composite component

* Update DropdownMenuV2 component

---

Co-authored-by: ciampo <[email protected]>
Co-authored-by: mirka <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants